package com.game.message.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.game.hall.model.GameUser;
import com.game.message.model.GameUserMessage;
import com.game.message.model.SysteMsage;
import com.jfinal.core.Controller;

public class SystmMesageApi extends Controller {

	/**
	 * 指定路径,route里的url+/getModel 获取用户Model
	 * 
	 * @return
	 */
	public void queryMesage() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<SysteMsage> querylist = SysteMsage.dao.findSysList();
		map.put("querylist", querylist);
		renderJson(querylist);
	}

	/**
	 * 
	 * 描述:获取用户发送的信息 作者:gyp
	 */
	public void getGameUserMessage() {

		String nickname = getPara("nickname");
		GameUser gu = GameUser.dao.getGameUserByNickName(nickname);

		List<GameUserMessage> infos = GameUserMessage.dao.getInfos(gu.get("id")
				.toString());
		setAttr("infos", infos);
		renderJson();
	}
}
